%% @author me
%% @doc @todo Add description to sc_event.


-module(sc_event).

%% ====================================================================
%% API functions
%% ====================================================================
-export([start_link/0,
		 add_handler/2,
		 delete_handler/2,
		 lookup/1,
		 create/2,
		 replace/2,
		 delete/1]).
-define(SERVER,?MODULE).
start_link() ->
	gen_event:start({local,?SERVER}).

add_handler(Handler,Args) ->
	gen_event:add_handler(?SERVER, Handler, Args).

delete_handler(Handler,Args) ->
	gen_event:delete_handler(?SERVER, Handler, Args).
lookup(Key) ->
	gen_event:notify(?SERVER, {lookup,Key}).

create(Key,Value) ->
	gen_event:notify(?SERVER, {create,{Key,Value}}).

replace(Key,Value) ->
	gen_event:notify(?SERVER, {replace,{Key,Value}}).

delete(Key) ->
	gen_event:notify(?SERVER, {delete,Key}).



%% ====================================================================
%% Internal functions
%% ====================================================================


